package com.songlanyun.modules.returnaddress.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.songlanyun.common.drive.RootEntity;
import com.songlanyun.common.validator.group.AddGroup;
import com.songlanyun.common.validator.group.UpdateGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * 商家收货地址
 *
 * @author lubo
 * @email sunlightcs@gmail.com
 * @date 2020-11-11 13:39:14
 */
@Data
@TableName("yxt_shop_return_address")
public class ReturnAddress extends RootEntity<Long,ReturnAddress> implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 *
	 */
	@TableId
	@NotNull(message = "修改时必须指定Id", groups = {UpdateGroup.class})
	@Null(message = "新增时不能指定Id", groups = {AddGroup.class})
	private Long id;
	/**
	 * 所属店铺id
	 */
	@NotNull(message = "必须指定所属店铺id", groups = {AddGroup.class,UpdateGroup.class})
	private Long shopId;
	/**
	 * 收货人
	 */
	@NotBlank(message = "收货人名称不能为空", groups = {AddGroup.class, UpdateGroup.class})
	@Length(min = 1, max = 50, message = "收货人名称长度在1-50个字", groups = {AddGroup.class, UpdateGroup.class})
	private String receiver;
	/**
	 * 电话
	 */
	@NotBlank(message = "收货人电话不能为空", groups = {AddGroup.class, UpdateGroup.class})
	@Length(min = 1, max = 20, message = "收货人电话长度在1-50个字", groups = {AddGroup.class, UpdateGroup.class})
	private String phone;
	/**
	 * 邮编
	 */
	@Length(max = 20, message = "邮编长度在0-20个字", groups = {AddGroup.class, UpdateGroup.class})
	private String postalCode;
	/**
	 * 经度
	 */
	private String longitude;
	/**
	 * 维度
	 */
	private String latitude;
	/**
	 * 详细地址
	 */
	@Length(min = 1,max = 200, message = "详细地址长度在1-200个字", groups = {AddGroup.class, UpdateGroup.class})
	private String address;
	/**
	 * 省名
	 */
	@Length(min = 1,max = 20, message = "省名长度在1-20个字", groups = {AddGroup.class, UpdateGroup.class})
	private String provinceName;
	/**
	 * 省编号
	 */
	@Length(min = 1,max = 20, message = "省编号长度在1-20个字", groups = {AddGroup.class, UpdateGroup.class})
	private String provinceCode;
	/**
	 * 市名
	 */
	@Length(min = 1,max = 20, message = "市名长度在1-20个字", groups = {AddGroup.class, UpdateGroup.class})
	private String cityName;
	/**
	 * 市编号
	 */
	@Length(min = 1,max = 20, message = "市编号长度在1-20个字", groups = {AddGroup.class, UpdateGroup.class})
	private String cityCode;
	/**
	 * 区名
	 */
	@Length(max = 20, message = "区名长度在0-20个字", groups = {AddGroup.class, UpdateGroup.class})
	private String areaName;
	/**
	 * 区编号
	 */
	@Length(max = 20, message = "区编号长度在0-20个字", groups = {AddGroup.class, UpdateGroup.class})
	private String areaCode;

	@TableField(fill = FieldFill.INSERT)
	private Date createTime;
	/**
	 *
	 */
	@TableField(fill = FieldFill.INSERT_UPDATE)
	private Date updateTime;

	@Override
	public Long getIdentity() {
		return null;
	}
}
